<?php ob_start() ?>

<div class="row">
    <div class="col-lg-12">
        <h1>Inicio <small>Resumen</small></h1>
    </div>
</div>
<hr>
<div class="row">
    <div class="col-lg-12">
        <div class="panel panel-info">
            <div class="panel-heading">
                <div class="row">
                    <div class="col-xs-6">
                        <i class="fa fa-users fa-5x"></i>
                    </div>
                    <div class="col-xs-6 text-right">
                        <p class="announcement-heading"><?php foreach ($num_anuncios as $fila){ echo $fila['numero_anuncios'];} ?></p>
                        <p class="announcement-text">Anuncios</p>
                    </div>
                </div>
            </div>
                <div class="panel-footer announcement-bottom">
                    <div class="row">
                        <div class="col-xs-6">
                            &nbsp;
                        </div>
                        <div class="col-xs-6 text-right">
                            &nbsp;
                        </div>
                    </div>
                </div>
        </div>
    </div>
</div>
<hr>
<div class="row" id="misanuncios">
    <div class="col-lg-12">
        <div class="panel panel-primary">
            <div class="panel-heading">
                <h3 class="panel-title"><i class="fa fa-suitcase"></i> Mis Anuncios</h3>
            </div>
            <div class="panel-body">
                <div class="table-responsive">
                    <table class="table table-bordered table-hover table-striped tablesorter" id="dataTables-example">
                        <thead>
                            <tr>
                                <th>Nombre <i class="fa fa-sort"></i></th>
                                <th>Descripción <i class="fa fa-sort"></i></th>
                                <th>Impresiones <i class="fa fa-sort"></i></th>
                                <th>Tarifa <i class="fa fa-sort"></i></th>
                                <th>Activo <i class="fa fa-sort"></i></th>
                                <th>Acciones <i class="fa fa-sort"></i></th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php //print_r($params_clientes) ?>
                            <?php foreach ($params_anuncios as $fila) { ?>
                                <tr<?php
                                if ($fila['activo'] == 0) {
                                    echo " class='danger' ";
                                }
                                ?>>
                                    <td><?php echo $fila['nombre'] ?></td>
                                    <td><?php echo substr($fila['descripcion'], 0, 30) ?> ...</td>
                                    <td><?php echo $fila['impresiones'] ?></td>
                                    <td><?php echo $fila['tarifanombre'] ?></td>
                                    <td><?php
                                        if ($fila['activo'] == 1) {
                                            echo 'Si';
                                        } else {
                                            echo 'No';
                                        }
                                        ?>
                                    </td>

                                    <td align="center"><a href="ver_anuncio/<?php echo $fila['id'] ?>"><i class="fa fa-search"></i></a></td>
                                </tr>
<?php } ?>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
        <?php
        if ($_SESSION['weokey_publicidad_tipo_usuario'] != md5('cliente')) {
            echo "<hr>";
            echo '<a class="btn btn-primary" href="registro_anuncio"><i class="fa fa-plus-circle"></i> Nuevo Anuncio</a>';
        }
        ?>

    </div>

    <?php
    $contenido = ob_get_clean();
    include "app/templates/$template.php";
    ?>